gl renderer: Initialize rounded rect early
authorTimm Bäder <mail@baedert.org>
Sun, 6 Dec 2020 18:57:48 +0000 (19:57 +0100)
committerTimm Bäder <mail@baedert.org>
Sun, 6 Dec 2020 18:57:48 +0000 (19:57 +0100)
gsk/gl/gskglrenderer.c

index 60bda9ea6340ba874f7fcb98b5951ce8fe122825..64996ffc705a64f38fcd6887286ec4f42b6d8d13 100644 (file)
@@ -1645,16 +1645,12 @@ render_clipped_child (GskGLRenderer         *self,
       /* well fuck */
       const float scale_x = builder->scale_x;
       const float scale_y = builder->scale_y;
+      const GskRoundedRect scaled_clip = GSK_ROUNDED_RECT_INIT (clip->origin.x * scale_x,
+                                                                clip->origin.y * scale_y,
+                                                                clip->size.width * scale_x,
+                                                                clip->size.height * scale_y);
       gboolean is_offscreen;
       TextureRegion region;
-      GskRoundedRect scaled_clip;
-
-      memset (&scaled_clip, 0, sizeof (GskRoundedRect));
-
-      scaled_clip.bounds.origin.x = clip->origin.x * scale_x;
-      scaled_clip.bounds.origin.y = clip->origin.y * scale_y;
-      scaled_clip.bounds.size.width = clip->size.width * scale_x;
-      scaled_clip.bounds.size.height = clip->size.height * scale_y;
 
       ops_push_clip (builder, &scaled_clip);
       if (!add_offscreen_ops (self, builder, &child->bounds,